CREATE TABLE IF NOT EXISTS `${modelMap.tableName}`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`create_date` DATETIME(6) NOT NULL COMMENT '创建时间',
`is_valid` BIT(1) NOT NULL COMMENT '是否有效。1：有效，0：无效',
`modify_date` DATETIME(6) NOT NULL COMMENT '修改时间',
`version` BIGINT(20) UNSIGNED NOT NULL COMMENT '版本号',
<#list modelMap.fields as field>
    `${field.columnName!}` ${field.jdbcType!} ${field.nullable?string('DEFAULT NULL','NOT NULL')} COMMENT '${field.comment!}' ,
</#list>
PRIMARY KEY (`id`),
<#list modelMap.indexFields as index>
    <#if index.isUnique>UNIQUE KEY `${index.name}` <#else>KEY `${index.name}` </#if>(<#list index.columns as c>`${c}`<#if c_has_next>,</#if></#list>) <#if index_has_next>,</#if>
</#list>
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT ='${modelMap.entityComment}';

